package com.financing.platform.dao.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.ISourceProductDao;
import com.financing.platform.dto.SourceProductDTO;
import com.financing.platform.util.SqlName;

@Repository("sourceProductDaoImpl")
public class SourceProductDaoImpl extends BaseDaoImpl implements ISourceProductDao {

	@Override
	public int addSourceProduct(SourceProductDTO sourceProduct) throws SQLException {
		sqlMapClient.insert(SqlName.insertSourceProduct,sourceProduct);
		return 0;
	}

	@Override
	public int deleteSourceProduct(SourceProductDTO sourceProduct) throws SQLException {
		 sqlMapClient.delete(SqlName.deleteSourceProduct,sourceProduct);
		 return 0;
	}
	
	@Override
	public List<Map<String, String>> querySourceProduct(SourceProductDTO sourceProduct) throws SQLException {
		return sqlMapClient.queryForList(SqlName.querySourceProduct,sourceProduct);
	}

}
